﻿#define  _CRT_SECURE_NO_WARNINGS 1

#include "SeqList.h"

void TestSeqList1()
{
	SL s1;
	SeqListInit(&s1);
	SeqListPushFront(&s1, 1);
	SeqListPushFront(&s1, 2);
	SeqListPushFront(&s1, 3);
	SeqListPushFront(&s1, 4);
	SeqListPushFront(&s1, 4);
	SeqListPushFront(&s1, 4);
	SeqListPushFront(&s1, 4);
	SeqListPushFront(&s1, 4);
	SeqListPushFront(&s1, 4);
	SeqListPushFront(&s1, 4);
	SeqListPushFront(&s1, 4);
	SeqListPushFront(&s1, 4);
	SeqListPushFront(&s1, 4);
	SeqListPushFront(&s1, 4);
	SeqListPushFront(&s1, 4);
	SeqListPushFront(&s1, 4);
	SeqListPushFront(&s1, 4);
	SeqListPrint(&s1);
}

void menu()
{
	printf("*****************************************\n");
	printf("         1.尾插数据  2.头插数据\n");
	printf("         3.尾删数据  4.头删数据\n");
	printf("         5.打印数据  -1.退出\n");
	printf("         请输入你要操作选项:");
	printf("\n*****************************************\n");
}

int main()
{
	SL s;
	SeqListInit(&s);
	int option = 0;
	int x = 0;
	while (option != -1)
	{
		menu();
		scanf("%d", &option);
		switch (option)
		{
		case 1:
			printf("请输入你要插入的数据，以-1结束\n");
			do
			{
				scanf("%d", &x);
				if (x != -1)
				{
					SeqListPushBack(&s, x);
				}
			} while (x != -1);
			break;
		case 2:
			break;
		case 3:
			break;
		case 4:
			break;
		case 5:
			SeqListPrint(&s);
			break;
		default:
			break;
		}
	}
	SeqListDestory(&s);
	return 0;
}